//
//  TitleMenuItem.cpp
//  FruitCrush
//
//  Created by gaoyu on 15/8/3.
//
//

#include "TitleMenuItem.h"
USING_NS_CC;


TitleMenuItem::TitleMenuItem()
{
}

TitleMenuItem * TitleMenuItem::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)
{
    return (TitleMenuItem *)MenuItemImage::create(normalImage, selectedImage, disabledImage, callback);
}

void TitleMenuItem::setTitle(const std::string& title,Size size)
{
    LabelTTF *numLabel = LabelTTF::create(title, "arial", 20);
    numLabel->setAnchorPoint(Point(0, 0));
    numLabel->setPosition((size.width-numLabel->getContentSize().width)/2,
                          (size.height - numLabel->getContentSize().height)/2);
    numLabel->setColor(Color3B::WHITE);
    addChild(numLabel);
}